<?php
session_start();

function get_request($key, $default = null)
{
    return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;
}

function get_request_or_die($key, $message)
{
    if (isset($_REQUEST[$key]))
        return  $_REQUEST[$key];
    else
        die($message);
}


function get_session($key, $default = null)
{
    return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
}

function get_session_or_die($key, $message)
{
    if (isset($_SESSION[$key]))
        return  $_SESSION[$key];
    else
        die($message);
}

function dump($obj)
{
    echo "<pre>";
    var_dump($obj);
    echo "</pre>";
    # die("end because of dump");
}


